<?php
/**
 * Notes:
 * User: Administrator
 * Date: 2020/3/5
 * Time: 11:36
 * ${PARAM_DOC}
 * @return ${TYPE_HINT}
 * ${THROWS_DOC}
 */

namespace app\api\model;


use think\Model;

class Userbank extends Model
{

    protected $name = 'userbank';

    public static function findInfoByCondition($condition = [])
    {
        return self::where($condition)->find();
    }

    public static function saveData($id, $data)
    {
        if ($id && $data) {
            return self::where(['id' => $id])->update($data);
        }
    }

    public static function saveDataByCondition($condition, $data)
    {
        if ($condition && $data) {
            return self::where($condition)->update($data);
        }
    }

    public static function findListByCondition($condition = [])
    {
        return self::where($condition)->order('is_default desc')->select();
    }

    public static function delRecord($id)
    {
        return self::where(['id' => $id])->delete();
    }

    public static function addRecord($addData)
    {
        return self::create($addData);
    }

}